package com.findMoneyGame.tools {
	import flash.display.BitmapData;

	import flash.geom.Matrix;
	import flash.geom.Rectangle;

	public class ImageAdjuster {
		public static function adjust (image : BitmapData, width : Number, height : Number) : BitmapData {
			var scaleX = width / image.width;
			var scaleY = height / image.height;
			var resized = new BitmapData(width, height);
			resized.draw(image, getScaleMatrix(scaleX, scaleY));
			return resized;
		}
		private static function getScaleMatrix (scaleX : Number, scaleY : Number) : Matrix {
			var m = new Matrix();
			m.scale(scaleX, scaleY);
			return m;
		}
	}
}